package com.tecode.controller;

import com.tecode.bean.UserBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.client.RestTemplate;

import java.util.List;

/**
 * Created by Administrator on 2019/5/20.
 */
@Controller
public class HelloSpringBoot {

    @RequestMapping("findFindAll")
    public String  findFindAll(Model model){
        RestTemplate restTemplate = new RestTemplate();
        List<UserBean> userBeanList = restTemplate.getForObject("http://localhost:8089/findAll",List.class);
        model.addAttribute("le",userBeanList);
        return "0011";
    }
}
